<template>
  <div style="display: flex;justify-content: center">
    <h1>采购入库</h1>
  </div>
  <el-row>
    <el-col :span="8">
      供应商<el-select v-model="customer" placeholder="请选择供应商" size="large" >
        <el-option label="戴尔" value="gz">戴尔</el-option>
        <el-option label="惠普" value="dz">惠普</el-option>
        <el-option label="神州" value="bk">神州</el-option>
      </el-select>
    </el-col>
    <el-col :span="8">采购人</el-col>
  </el-row>

  <el-row style="margin-top: 30px">
    <el-col :span="4">
      采购物品
    </el-col>
  </el-row>

  <div>
    <el-table :data="cutBean.records" style="width: 100%;border: 1px #000 solid">
      <el-table-column prop="name" label="商品名称"/>
      <el-table-column prop="job" label="品牌"/>
      <el-table-column prop="birthday" label="采购价"/>
      <el-table-column prop="price" label="采购数量"/>
      <el-table-column fixed="right" label="操作" width="220">
        <template #default="scope">
          <el-button type="danger" @click="del(scope.row)">移除商品</el-button>
        </template>
      </el-table-column>
    </el-table>
<!--    <el-pagination-->
<!--        v-model:currentPage="cutBean.current"-->
<!--        v-model:page-size="cutBean.size"-->
<!--        background-->
<!--        layout="prev, pager, next, jumper"-->
<!--        :total="cutBean.total"-->
<!--        @current-change="findByItem"-->
<!--    />-->
  </div>
  <el-row style="margin-top: 30px">
    <el-col :span="12">
      <el-button type="primary" @click="addVisible = true">添加商品</el-button>
    </el-col>
    <el-col :span="12">
      <el-button type="primary" @click="add()">入库</el-button>
    </el-col>
  </el-row>

  <!--  添加div -->
  <el-dialog
      v-model="addVisible"
      title="添加商品"
      width="60%"
  >
    <el-row style="width: 100%;line-height: 40px">
      <el-col :span="3">
        <p>商品编号:</p>
        <p>商品名称: </p>
        <p>品牌: </p>
      </el-col>
      <el-col :span="7">
        <p><el-input v-model="productObj.id"/></p>
        <p><el-input v-model="productObj.name"/></p>
        <p><el-input v-model="productObj.brand"/></p>
      </el-col>
      <el-col :span="1"></el-col>
      <el-col :span="4">
        <p><el-button>
          选择图片
        </el-button></p>

      </el-col>
      <el-col :span="7">
        <el-image src="" style="width: 150px;height: 150px"></el-image>
      </el-col>
    </el-row>
    <el-row style="width: 100%;line-height: 40px">
      <el-col :span="3">
        <p>类别:</p>
        <p>最新采购价: </p>
      </el-col>
      <el-col :span="7">
        <p>
          <el-select v-model="customer" placeholder="请选择类别" size="large" >
            <el-option label="戴尔" value="gz">戴尔</el-option>
            <el-option label="惠普" value="dz">惠普</el-option>
            <el-option label="神州" value="bk">神州</el-option>
          </el-select>
          </p>
        <p><el-input v-model="productObj.buyPrice"/></p>
      </el-col>
      <el-col :span="1"></el-col>
      <el-col :span="4">
        <p>库存数量:</p>
        <p>建议销售价: </p>
      </el-col>
      <el-col :span="7">
        <p>  <el-input v-model="productObj.num"/></p>

        <el-input v-model="productObj.sellPrice"/>
      </el-col>
    </el-row>


    <template #footer>
      <span class="dialog-footer">
        <el-button @click="addVisible = false">返回</el-button>
          <el-button @click="addVisible = false">添加</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script>
export default {
name: "buyer",
data(){
    return{
      customer:"",
      productObj:{},
      supplierObj: {},
      cutBean: {
        records: [
          {id: 2, name: "haha", job: "老板", birthday: "1993-02-01",price:"20555"},
          {id: 3, name: "oo", job: "boss", birthday: "1996-02-01"},
          {id: 1, name: "dd", job: "boss2", birthday: "1995-02-01"},
          {id: 4, name: "cc", job: "boss3", birthday: "1994-02-01"},
        ],
        total: 20,
        pages: 5,
        size: 4,
        current: 1
      },
      addVisible: false,
      infoVisible:false,
        }
    }
}
</script>

<style scoped>

</style>